package com.example.check.service;

import com.example.check.entity.UserEntity;
import org.apache.shiro.subject.Subject;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;

/**
 * Created by 13296 on 2017/7/13.
 */
public interface UserService {
    /**
     * 用户登录
     * @param account
     * @param password
     * @return
     * @throws Exception
     */
    UserEntity login(String account,String password, Subject subject)throws Exception;

    ArrayList<UserEntity> searchAllUser()throws Exception;

    @Transactional   //提交事务
    UserEntity updatePassword(int id,String oldPassword,String newPassword,String newPasswordConfirm)throws Exception;

    @Transactional
    UserEntity enroll(String account,String password,String name,String roleLevel,String sex,String telephone,String email,String address)throws Exception;

    UserEntity SearchUserByID(int code) throws Exception;

    void deleteUserById(int id) throws Exception;

    void editUser(UserEntity user)throws Exception;

    ArrayList<UserEntity> SearchUserByField(String field, String code) throws Exception;

    ArrayList<UserEntity> SearchUserLikeByField(String field, String code) throws Exception;

    void giveUserRole(int id,String role)throws Exception;


}
